package haierhome.krund.cn.daggertworetrofitrxjavamvp.rxjava.exampletwo.net;

import com.google.gson.annotations.SerializedName;

import haierhome.krund.cn.daggertworetrofitrxjavamvp.rxjava.exampletwo.constants.Constants;

/**
 * Created by Administrator on 2018/8/14.
 */

public class HttpStatus {

    private int errorCode=-1;
    private String errorMsg;


    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    /**
     * API是否请求失败
     *
     * @return 失败返回true, 成功返回false
     */
    public boolean isCodeInvalid() {
        return errorCode != Constants.WEB_RESP_CODE_SUCCESS;
    }
}
